package router

import (
	"github.com/gin-gonic/gin"
	"go_spider_api/controller"
)

func Setup() *gin.Engine {

	r := gin.New()

	// 重启二手房租房服务
	r.GET("/tfy/restart_spider", controller.StartEsfZf)

	// 停止二手房租房爬虫服务
	r.GET("/tfy/kill_spider", controller.KillEsfZf)

	// 启动小区爬虫服务
	r.GET("/tfy/start_xiaoqu", controller.StartXq)
	// 杀死小区爬虫
	r.GET("/tfy/kill_xiaoqu", controller.KillXq)

	// 启动楼盘爬虫
	r.GET("/tfy/start_loupan/:spider_name", controller.StartLouPan)
	// 杀死楼盘爬虫
	r.GET("/tfy/kill_loupan/:spider_name", controller.KillLouPan)
	return r

}
